import {
    SCHEDULE_INIT,
    SCHEDULE_CHANGE
    } from '../actions';
  import { updateState } from '../utils';
  
    const INITIAL_STATE = {
      schedule: '',
      isFinished: 0,  // 这里代表期次有没有结束, 0 未结束
      state:{
        data: {},
        page: {
          
        }
      }
    };
    
    export default function (state = INITIAL_STATE, action = {}) {
      switch (action.type) {
        case SCHEDULE_INIT:
          {
            return {  ...state, ...INITIAL_STATE }
          }
        case SCHEDULE_CHANGE:
          {
            return updateState(state, action.data);
          }
        default:
          return state;
      }
    }